#include <iostream>
#include <vector>
#include <queue>
using namespace std;

bool isBipartite(vector<vector<int>>& graph, int src) {
  int n = graph.size();
  vector<int> color(n, -1);

  color[src] = 0;
  queue<int> q;
  q.push(src);

  while (!q.empty()) {
    int u = q.front();
    q.pop();

    for (int v : graph[u]) {
      if (color[v] == -1) {
        color[v] = 1 - color[u];
        q.push(v);
      } else if (color[v] == color[u]) {
        return false; 
      }
    }
  }

  return true; 
}

bool isBipartiteGraph(vector<vector<int>>& graph) {
  int n = graph.size();

  for (int i = 0; i < n; i++) {
    if (!isBipartite(graph, i)) {
      return false; 
    }
  }

  return true; 
}

int main() {
  vector<vector<int>> graph = {{1, 3}, {0, 2}, {1, 3}, {0, 2}};

  if (isBipartiteGraph(graph)) {
    cout << "图是二分图" << endl;
  } else {
    cout << "图不是二分图" << endl;
  }

  return 0;
}